package io.renren.modules.sys.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.sys.dao.QrCodeDao;
import io.renren.modules.sys.entity.QrCodeEntity;
import io.renren.modules.sys.service.QrCodeService;


@Service("qrCodeService")
public class QrCodeServiceImpl extends ServiceImpl<QrCodeDao, QrCodeEntity> implements QrCodeService {

    @Autowired
    private QrCodeDao qrCodeDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<QrCodeEntity> page = this.page(
                new Query<QrCodeEntity>().getPage(params),
                new QueryWrapper<QrCodeEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public boolean saveAll(QrCodeEntity entity) {
        return qrCodeDao.saveAll(entity);
    }

    @Override
    public boolean removeByBatchId(List<Integer> idList) {
        return qrCodeDao.removeByBatchId(idList);
    }

}
